package cn.sciento.boot.data.change.selector.manager;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.apache.commons.collections4.CollectionUtils;
import cn.sciento.boot.data.change.selector.AbstractEntityTableSelector;

public class DefaultEntityTableSelectorManager extends EntityTableSelectorManager {
  protected List<AbstractEntityTableSelector> doCompose(List<AbstractEntityTableSelector> entityTableSelectors) {
    if (CollectionUtils.isEmpty(entityTableSelectors))
      return Collections.emptyList(); 
    entityTableSelectors.sort(Comparator.comparingInt(AbstractEntityTableSelector::getOrder));
    return entityTableSelectors;
  }
}
